package Server.TechnicalServices.Mapper;


import Server.Entity.Dominio.EConsulente;
import Server.Entity.Dominio.EManager;
import Server.Entity.IceClasses.EAziendaI;
import Server.Entity.IceClasses.EConsulenteI;
import Server.Entity.IceClasses.EManagerI;

public class MManager implements Mapper {

	@Override
	public EManagerI getIceObj(Object hibObj) {

		EManagerI iceConsulente = null;
		
		if ( hibObj instanceof EManager)
		{
			iceConsulente = new EManagerI();
			
			iceConsulente.cognome = ((EManager) hibObj).getCognome();
			iceConsulente.nome = ((EManager) hibObj).getNome();
			iceConsulente.matricola = ((EManager) hibObj).getMatricola();
			iceConsulente.password = ((EManager) hibObj).getPassword();
			iceConsulente.username = ((EManager) hibObj).getUsername();
			
		}
		
		return iceConsulente;
	}

	@Override
	public EManager getHibObj(Object iceObj) {

		EManager hibManager = null;
		
		if ( iceObj instanceof EManagerI)
		{
			hibManager = new EManager();
			
			hibManager.setCognome(((EManagerI) iceObj).cognome);
			hibManager.setNome(((EManagerI) iceObj).nome);
			hibManager.setMatricola(((EManagerI) iceObj).matricola);
			hibManager.setPassword(((EManagerI) iceObj).password);
			hibManager.setUsername(((EManagerI) iceObj).username);
		}
		
		return hibManager;
		
	}

}


